﻿using System.Collections.Generic;

namespace System.Web.Mvc
{
    public static class EnumerableExtensions
    {
        public static void Each<T>(this IEnumerable<T> instance, Action<T> action)
        {
            if (instance == null)
            {
                return;
            }
            foreach (T item in instance)
            {
                action(item);
            }
        }
    }
}